<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-touch-fullscreen" content="yes">
		<meta name="format-detection" content="telephone=no;email=no">

		<link rel="stylesheet" href="../css/mui.min.css">
		<title>广告页</title>
		<style>
			html,
			body {
				background-color: #fff;
			}
			
			.ad{
				display: block;
			}
			
			.close-btn{
				position: absolute;
				top: 3%;
				right: 5%;
				color: #fff;
				background-color: #aaa;
			}
		</style>
	</head>

	<body>
		<img id="ad" class="ad" alt="" width="100%" height="100%">
		<button id="close" class="mui-btn mui-btn-outlined close-btn">跳过</button>

		<script src="../js/mui.min.js"></script>
		<script src="../js/common.js"></script>
		<script>
			//预加载首页
			mui.init({
				preloadPages: [{
					url: '../main.html',
					id: 'main',
				}],
			});
			mui.plusReady(function() {
				document.getElementById("ad").src = plus.storage.getItem("ad");
				if (mui.os.ios) {
					plus.navigator.setFullscreen(true);
				}
				plus.navigator.closeSplashscreen();
			});
			//自动关闭事件
			setTimeout(function() {
//				plus.webview.currentWebview().close();
				//显示main页面
				plus.navigator.setFullscreen(false);
				mui.openWindow({
					url: 'main.html',
					id: 'main',
					show: {
						aniShow: 'none'
					},
					waiting: {
						autoShow: false
					}
				});										
			}, 7000);			
			//关闭点击事件
			document.getElementById("close").addEventListener('tap', function(event) {
//				plus.webview.currentWebview().close();
				plus.navigator.setFullscreen(false);
				mui.openWindow({
					url: 'main.html',
					id: 'main',
					show: {
						aniShow: 'none'
					},
					waiting: {
						autoShow: false
					}
				});	
			}, false);
		</script>
	</body>

</html>